package com.itheima.text1;


import com.itheima.text1.Student;

import java.util.TreeSet;

public class Demo4Student1 {
    public static void main(String[] args) {
        TreeSet<Student> set = new TreeSet<>();

        set.add(new Student("Tom",20,90));
        set.add(new Student("Jerry",22,95));
        set.add(new Student("John",20,100));
        set.add(new Student("Lily",22,100));
        set.add(new Student("Lucy",22,90));
        set.add(new Student("Kevin",22,90));

        for (Student stu : set) {
            System.out.println(stu);
        }

    }

}
